#ifndef HPMAINWINDOW_H
#define HPMAINWINDOW_H

#include <QMainWindow>
#include "HPGraphicsScene.h"
#include <QtWebKit/QtWebKit>
#include "HPTools.h"

namespace Ui
{
    class HandiPaintMainWindow;
}

class HandiPaintMainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit HandiPaintMainWindow(QWidget *parent = 0);
    ~HandiPaintMainWindow();

    void paintEvent(QPaintEvent *);

public: signals:
    void fpsUpdated( int fps );
public slots:

    void configureCanvasFormat( QString format );
    void configureCanvasFormat( QSize size );
    void changePenType( PenType penType );

private slots:

    void on_actionAProposQt_triggered();

    void on_actionAProposHandiPeintres_triggered();

    void on_actionAProposHandiPaint_triggered();

    void onSceneChanged(QList<QRectF>);

    void onPenPathChanged();

    void on_buttonCreateLayer_clicked();

    void on_buttonOpen_clicked();

    void on_buttonSave_clicked();

    void on_buttonEmail_clicked();

    void on_toolPencil18_clicked();

    void on_toolPencil14_clicked();

    void on_toolPencil10_clicked();

    void on_toolPencil6_clicked();

    void on_toolPencil2_clicked();

    void on_toolFeltTip_clicked();

    void on_toolMechanicalPencil_clicked();

    void on_toolRule_clicked(bool checked);

    void on_toolEraser_clicked(bool checked);

    void on_toolEraser_pressed();

    void on_toolEraser_released();

    void on_color1_clicked();

    void on_color2_clicked();

    void on_color3_clicked();

    void on_color4_clicked();

    void on_color5_clicked();

    void on_color6_clicked();

    void on_color7_clicked();

    void on_color8_clicked();

    void on_color9_clicked();

    void on_color10_clicked();

    void on_color11_clicked();

    void on_color12_clicked();

    void on_color13_clicked();

    void on_color14_clicked();

private:

    void initSettingsDefault();

private:
    Ui::HandiPaintMainWindow *  ui;
    HPGraphicsScene          *  m_pGraphicsScene;
    QSettings                   m_settings;
    QWebView*                   m_pWebView;
    QRect                       m_viewRectInit;
};

#endif // HPMAINWINDOW_H
